* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #0f172a 100%);
    color: white;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Effects */
.bg-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjAiIGhlaWdodD0iNjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PHBhdHRlcm4gaWQ9ImdyaWQiIHdpZHRoPSI2MCIgaGVpZ2h0PSI2MCIgcGF0dGVyblVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHBhdGggZD0iTSAxMCAwIEwgMCAwIDAgMTAiIGZpbGw9Im5vbmUiIHN0cm9rZT0icmdiYSgyNTUsMjU1LDI1NSwwLjAzKSIgc3Ryb2tlLXdpZHRoPSIxIi8+PC9wYXR0ZXJuPjwvZGVmcz48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSJ1cmwoI2dyaWQpIi8+PC9zdmc+');
    opacity: 0.2;
    z-index: 0;
}

.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
    z-index: 0;
}

/* Floating Elements */
.floating-element {
    position: fixed;
    border-radius: 50%;
    opacity: 0.1;
    animation: float 20s infinite ease-in-out;
    z-index: 0;
}

.float-1 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.float-2 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    top: 60%;
    right: 15%;
    animation-delay: 7s;
}

.float-3 {
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    bottom: 20%;
    left: 20%;
    animation-delay: 14s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-50px) rotate(180deg);
    }
}

/* Content */
.content {
    position: relative;
    z-index: 10;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* ===============================
   👤 Header User UI - Navy Pro Edition
   =============================== */

/* جعل الهيدر حاوية مرجعية */
.header {
    position: relative;
    padding: 3rem 1rem;
    text-align: center;
}

/* زر Login المطور */
.btn-login {
    position: absolute;
    top: 25px;
    right: 25px;
    background: linear-gradient(135deg, #162b65 0%, #223b71 100%);
    border: 1px solid rgba(147, 197, 253, 0.3);
    padding: 10px 24px;
    border-radius: 10px;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    /* لضمان توسيط الكلمة تماماً */
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-login a {
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase; /* جعل الحروف كبيرة يعطي فخامة */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
}

/* قائمة المستخدم الكحلية الزجاجية */
.user-menu {
    position: absolute;
    top: 25px;
    right: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(14, 33, 75, 0.85);
    backdrop-filter: blur(12px);
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    z-index: 100;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.user-name {
    color: #93c5fd; 
    font-weight: 600;
    font-size: 0.95rem;
    /* منع التفاف النص */
    white-space: nowrap;
}

/* زر تسجيل الخروج المطور */
.logout-btn {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5; /* لون أحمر ناعم */
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    /* تحسين التمركز الداخلي للكلمة */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1; /* يرفع النص قليلاً للأعلى ليظهر في المنتصف */
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

/* إخفاء افتراضي */
.user-menu.hidden {
    display: none !important;
}




.header-icons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.icon-box {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.3);
    animation: pulse-glow 3s infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 10px 30px rgba(59, 130, 246, 0.3);
    }
    50% {
        box-shadow: 0 15px 40px rgba(59, 130, 246, 0.5);
    }
}

.title {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.25rem;
    color: #cbd5e1;
    margin-bottom: 2rem;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Stats Bar */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:nth-child(1) {
    border-color: rgba(59, 130, 246, 0.3);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05));
}

.stat-card:nth-child(2) {
    border-color: rgba(34, 197, 94, 0.3);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(34, 197, 94, 0.05));
}

.stat-card:nth-child(3) {
    border-color: rgba(168, 85, 247, 0.3);
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(168, 85, 247, 0.05));
}

.stat-card:nth-child(4) {
    border-color: rgba(251, 146, 60, 0.3);
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.1), rgba(251, 146, 60, 0.05));
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.stat-label {
    font-size: 0.875rem;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
}

/* Section Header */
.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 1rem;
    padding: 1.5rem;
}

.section-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.filter-bar label {
    color: #94a3b8;
    font-size: 0.875rem;
}

.filter-bar select {
    padding: 0.5rem 1rem;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 0.5rem;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-bar select:focus {
    outline: none;
    border-color: #60a5fa;
}

/* Records Container */
.records-container {
    display: grid;
    gap: 1.5rem;
}

/* Trip Card */
.trip-card {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.trip-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Color Schemes */
.color-scheme-blue {
    border-color: rgba(59, 130, 246, 0.3);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(6, 182, 212, 0.1));
}

.color-scheme-purple {
    border-color: rgba(168, 85, 247, 0.3);
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(236, 72, 153, 0.1));
}

.color-scheme-green {
    border-color: rgba(34, 197, 94, 0.3);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(16, 185, 129, 0.1));
}

.color-scheme-orange {
    border-color: rgba(251, 146, 60, 0.3);
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.1), rgba(239, 68, 68, 0.1));
}

.trip-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.trip-header i {
    color: #60a5fa;
}

.trip-header span {
    color: #cbd5e1;
    font-size: 0.875rem;
}

/* Trip Route */
.trip-route {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.route-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.route-label {
    font-size: 0.75rem;
    color: #94a3b8;
}

.route-value {
    color: white;
    font-weight: 500;
}

/* Trip Details */
.trip-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.detail-item {
    background: rgba(15, 23, 42, 0.3);
    border-radius: 0.5rem;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-item span {
    font-size: 0.75rem;
    color: #94a3b8;
}

.detail-item strong {
    font-size: 1rem;
    color: white;
}

.eta-value {
    color: #60a5fa;
}

.diff-value {
    color: #94a3b8;
}

.diff-positive {
    color: #fb923c;
}

.diff-negative {
    color: #4ade80;
}

/* Traffic Badge */
.traffic-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.traffic-light {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.traffic-moderate {
    background: rgba(234, 179, 8, 0.2);
    color: #facc15;
}

.traffic-heavy {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* Empty State */
.empty {
    text-align: center;
    color: #94a3b8;
    padding: 3rem;
    font-size: 1.125rem;
}

/* Responsive */
@media (max-width: 768px) {
    .title {
        font-size: 2.5rem;
    }

    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }

    .trip-details {
        grid-template-columns: repeat(2, 1fr);
    }

    .btn-logout {
        top: 1rem;
        right: 1rem;
        padding: 0.5rem 1rem;
    }
}